<template>
  <v-app id="app">
    <v-navigation-drawer
      fixed
      app
      clipped
      width="250"
      :mini-variant="mini"
      v-model="drawer"
    >
      <v-toolbar
        flat
        class="transparent">
          <v-list>
            <v-list-tile avatar>
              <v-list-tile-avatar id="head" @click="mini = !mini">
                <img src="@/assets/me.jpg" >
              </v-list-tile-avatar>
              <v-list-tile-content id="head1">
                <v-list-tile-title>{{ myName }}</v-list-tile-title>
              </v-list-tile-content>
              <v-list-tile-action>
                <v-btn icon @click.native.stop="mini = !mini">
                  <v-icon>chevron_left</v-icon>
                </v-btn>
              </v-list-tile-action>
            </v-list-tile>
          </v-list>
        </v-toolbar>
      <v-list dense class="pa-0">
        <v-divider></v-divider>
        <v-list-tile v-for="item in items" :key="item.title" :to="item.to">
          <v-list-tile-action>
            <v-icon medium>{{ item.icon }}</v-icon>
          </v-list-tile-action>
          <v-list-tile-content>
            <v-list-tile-title>{{ item.title }}</v-list-tile-title>
          </v-list-tile-content>
        </v-list-tile>
      </v-list>
    </v-navigation-drawer>
    <v-toolbar
      color="primary"
      dark
      app
      fixed
      clipped-left
      scroll-off-screen
      scroll-target="#bottom"
    >
      <v-toolbar-side-icon white @click.stop="drawer = !drawer"></v-toolbar-side-icon>
      <v-toolbar-title class="white--text">{{ siteTitle }}</v-toolbar-title>
      <v-spacer></v-spacer>
      <v-btn flat color="white" @click="about_sheet = !about_sheet">
        <v-icon>person_outline</v-icon>About me</v-btn>
    </v-toolbar>
    <div
      class="scroll-y"
      id="scrolling-techniques"
      >
    <v-bottom-sheet v-model="about_sheet">
      <v-list>
        <h3><v-avatar><img src="@/assets/me.jpg"></v-avatar>&nbsp;&nbsp;About me</h3>
        <v-list-tile>
        </v-list-tile>
      </v-list>
    </v-bottom-sheet>
    <v-content>
      <router-view/>
    </v-content>
    </div>
    <v-footer id='bottom' app absolute inset clipped-left class="pa-3">
      <!-- <v-spacer></v-spacer> -->
      <v-flex text-xs-center grey--text>
        蜀ICP备18004931 Data Geek © {{ new Date().getFullYear() }}
      </v-flex>
    </v-footer>
  </v-app>
</template>

<script>
export default {
  name: 'App',
  data () {
    return {
      drawer: true,
      about_sheet: false,
      mini: true
    }
  },
  methods: {
    manageTags () {
      console.log('manageTags')
    }
  },
  computed: {
    siteTitle () {
      return this.$store.state.global.title
    },
    myName () {
      return this.$store.state.global.me
    },
    items () {
      return this.$store.state.global.siteMap
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
#head, #head1 {
  cursor: pointer;
}
.btn {
  text-transform: none !important;
}
</style>
